package com.hnhp.dto;

import lombok.Data;

@Data
public class ResponseDto {
    private int code;
    private String message;
    private Object data;

    //成功了返回正确数据
    public static ResponseDto success(Object data){
        ResponseDto dto= new ResponseDto();
        dto.setCode(0);
        dto.setData(data);
        return dto;
    }
    //返回错误数据
    public static ResponseDto error(int code,String msg){
        ResponseDto dto= new ResponseDto();
        dto.setCode(code);
        dto.setMessage(msg);
        return dto;
    }



}
